package mr.ali.videoapp.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.videoapp.portal.model.CollectionYurt;
import mr.ali.videoapp.portal.mapper.CollectionYurtMapper;
import mr.ali.videoapp.portal.service.ICollectionYurtService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-06-01
 */
@Service
public class CollectionYurtServiceImpl extends ServiceImpl<CollectionYurtMapper, CollectionYurt> implements ICollectionYurtService {
    @Resource
    private CollectionYurtMapper collectionYurtMapper;

    @Override
    public List<CollectionYurt> findByAll() {
        QueryWrapper<CollectionYurt> queryWrapper = new QueryWrapper<>();
        return collectionYurtMapper.selectList(queryWrapper);
    }

    @Override
    public CollectionYurt findBySortID(Integer typeId){
        QueryWrapper<CollectionYurt> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_id", typeId);
        return collectionYurtMapper.selectOne(queryWrapper);
    }
}
